package com.manli.api.util;

import com.alibaba.druid.filter.config.ConfigTools;

public class DruidUtils {
	 
	/**
	 * 加密
	 * @param password
	 * @throws Exception
	 */
    public static String generateEncryptPassword(String password) throws Exception {
        return Encrypt.encrypt(password);
    }
    /**
     * 解密
     *
     * @param encryptPassword
     * @return
     * @throws Exception
     */
    public static String generateEncryptPasswordToRealPassword(String encryptPassword) throws Exception {
        return Encrypt.decrypt( encryptPassword);
    }
    
    /**
     * 姐妹
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception{
//    	ConfigTools.main(new String[]{"mysql"});
//    	System.out.println(ConfigTools.decrypt("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAM3De1AzleW0p7OBSoaoxkE24uBID8S5L6NFI4qmOkzRvi6FN/k0zrhQRmQmszrhOvoZciYt19ADfbRZ6QE24+MCAwEAAQ==",
//    			"WqUY1ChSz5sm163gd9Sjo/7jB/+5fVjvyHoeFFpEDqyZmnWVucRUIkR5d4X3Pz5chCwBcnjxoy5TKi+a9Zsr1w=="));

//        Encrypt.main(new String[]{"mysql"});
//            	System.out.println(ConfigTools.decrypt("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAM3De1AzleW0p7OBSoaoxkE24uBID8S5L6NFI4qmOkzRvi6FN/k0zrhQRmQmszrhOvoZciYt19ADfbRZ6QE24+MCAwEAAQ==",
//    			"WqUY1ChSz5sm163gd9Sjo/7jB/+5fVjvyHoeFFpEDqyZmnWVucRUIkR5d4X3Pz5chCwBcnjxoy5TKi+a9Zsr1w=="));

        System.out.println(Encrypt.encrypt("1"));
        System.out.println(Encrypt.decrypt("TPse9mhxSf4wXfLjwD92ykzDES3NCxWFDYAYnee/q+RHssI5arBcfVCoAQ+zQbYJ7AazvCat725mOEJdlAYCsA=="));
	}

 
}